package com.wenhai.configuration.metadata;

import com.wenhai.xiaomage.spring.ioc.overview.dependency.domain.User;
import org.springframework.beans.factory.support.*;

/**
 * {@link DefaultBeanNameGenerator} 示例
 *
 * @author wenhai
 * @date   2020/9/28
 */
public class DefaultBeanNameDemo {
    public static void main(String[] args) {
        AbstractBeanDefinition beanDefinition = BeanDefinitionBuilder.genericBeanDefinition().getBeanDefinition();
        beanDefinition.setBeanClass(User.class);
        DefaultListableBeanFactory beanFactory = new DefaultListableBeanFactory();
        System.out.println(BeanDefinitionReaderUtils.generateBeanName(beanDefinition, beanFactory));
    }
}
